%Calculates the well_exposedness of Image based on how close it's RGB
%values are to the center of the range
function [WE] = well_exposedness(Image)
I = Image;
[height,width,rgb] = size(I);
sigma = 0.2;

WE = zeros(height,width);
% apply weights to intensities
for i = 1:height
    for j = 1:width
        WE(i,j) = exp(-(I(i,j,1) - 0.5).^2/(2*sigma^2))*exp(-(I(i,j,2) - 0.5).^2/(2*sigma^2))*exp(-(I(i,j,3) - 0.5).^2/(2*sigma^2));
    end
end

